/*
 * Android Runner is a multiplayer GPS game fully written by Xurxo Mendez Perez
 * 
 * Copyright (C) 2009 Xurxo Mendez Perez
 *   
 * This file is part of Android Runner.
 * 
 * Android Runner is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Android Runner is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Android Runner.  If not, see <http://www.gnu.org/licenses/>.
 */

package es.sonxurxo.gpsgame.client.model.service.game;

import java.util.List;

import es.sonxurxo.gpsgame.client.model.service.to.Game;
import es.sonxurxo.gpsgame.client.model.service.to.GameCTO;
import es.sonxurxo.gpsgame.client.model.service.to.response.AnswerQuestionResponseTO;
import es.sonxurxo.gpsgame.client.model.service.to.response.GenericGameResponseTO;
import es.sonxurxo.gpsgame.client.model.service.to.response.GetItemResponseTO;
import es.sonxurxo.gpsgame.client.model.service.to.response.StartOrContinueGameResponseTO;
import es.sonxurxo.gpsgame.client.model.util.http.HttpHelper;

/**
 * 
 * @author "Xurxo Mendez Perez"
 *
 */
public class HttpGameServiceImpl implements GameService {

	public boolean abandonGame(long gameId) throws Exception {
		return HttpHelper.getInstance().abandonGame(gameId);
	}

	public AnswerQuestionResponseTO answerQuestion(long questionId,
			int latitude, int longitude) throws Exception {
		return HttpHelper.getInstance().answerQuestion(
				questionId, latitude, longitude);
	}

	public List<String> findCitiesWithGames() throws Exception {
		return HttpHelper.getInstance().findCitiesWithGames();
	}

	public Game findGame(String gameId) throws Exception {
		return HttpHelper.getInstance().findGame(gameId);
	}

	public GameCTO findGamesByCity(String city, int startIndex, int count) 
	throws Exception {
		return HttpHelper.getInstance().findGamesByCity(city, 
				startIndex, count);
	}

	public GameCTO findGamesByLocation(int latitude, int longitude,
			int accurate, int startIndex, int count) throws Exception {
		return HttpHelper.getInstance().findGamesByLocation(
				latitude, longitude, accurate, startIndex, count);
	}

	public GetItemResponseTO getItem(int latitude, int longitude, long itemId)
			throws Exception {
		return HttpHelper.getInstance().getItem(latitude, longitude, itemId);
	}

	public boolean joinGame(long gameId) throws Exception {
		return HttpHelper.getInstance().joinGame(gameId);
	}

	public boolean sendMessage(String receiverLogin, String body)
			throws Exception {
		return HttpHelper.getInstance().sendMessage(receiverLogin, body);
	}

	public StartOrContinueGameResponseTO startOrContinueGame(String login)
			throws Exception {
		return HttpHelper.getInstance().startOrContinueGame(login);
	}

	public GenericGameResponseTO updateLocation(int latitude, int longitude)
			throws Exception {
		return HttpHelper.getInstance().updateLocation(latitude, longitude);
	}

}
